package gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;

import javax.swing.JMenuItem;
import javax.swing.JOptionPane;

/**
 * 
 * @author vincenzo.delia@polito.it
 *
 */
@SuppressWarnings("serial")
public class HelpMenu extends HcsGuiMenu {

	private CommandMenuBar commandMenuBar;
	
	public String aboutMessage = "<html>" +
	"<strong>Heating Control System</strong><br>" +
	"<em>See javadocs for details about design and coding</em>" + 
	"</html>";


	
	public ActionListener ShowAbout = new ActionListener() {
		public void actionPerformed(ActionEvent e) {
			MainFrame frame = commandMenuBar.getMainFrame();
			JOptionPane.showMessageDialog(frame, aboutMessage, "About", JOptionPane.INFORMATION_MESSAGE);
		}
	};

	public HelpMenu(CommandMenuBar commandMenuBar) {
		super("Help");
		this.setMnemonic(KeyEvent.VK_H);
		this.commandMenuBar = commandMenuBar;
		JMenuItem menuItem = new JMenuItem("About");
		this.add(menuItem);
		menuItem.addActionListener(ShowAbout);
	}

	@Override
	public CommandMenuBar getCommandMenuBar() {
		return this.commandMenuBar;
	}

}
